package com.liarjo.my_website_api.admin.controller.messageboard;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.liarjo.my_website_api.admin.controller.messageboard.page.AdminMessageboardPageRequest;
import com.liarjo.my_website_api.admin.controller.messageboard.page.AdminMessageboardPageResult;


@Service
public class AdminMessageboardService {
    @Autowired
    private AdminMessageboardMapper messageBoardMapper;

    public IPage<AdminMessageboardPageResult> page(AdminMessageboardPageRequest messageBoardPageRequest) {
        IPage<AdminMessageboardPageResult> page = new Page<>(messageBoardPageRequest.getCurrent(),messageBoardPageRequest.getSize());
        return messageBoardMapper.page(messageBoardPageRequest, page);
    }
}
